load(
    "//tools:defaults.bzl",
    "markdown_to_html",
    "ng_project",
    "ng_web_test_suite",
    "sass_binary",
    "sass_library",
)

package(default_visibility = ["//visibility:public"])

ng_project(
    name = "text-field",
    srcs = glob(
        ["**/*.ts"],
        exclude = ["**/*.spec.ts"],
    ),
    assets = [
        ":text-field-prebuilt.css",
    ],
    deps = [
        "//:node_modules/@angular/common",
        "//:node_modules/@angular/core",
        "//:node_modules/rxjs",
        "//src/cdk/coercion",
        "//src/cdk/platform",
        "//src/cdk/private",
    ],
)

sass_library(
    name = "text_field_scss_lib",
    srcs = glob(["**/_*.scss"]),
)

sass_binary(
    name = "text_field_prebuilt_scss",
    src = "text-field-prebuilt.scss",
    deps = [":text_field_scss_lib"],
)

ng_project(
    name = "unit_test_sources",
    testonly = True,
    srcs = glob(
        ["**/*.spec.ts"],
        exclude = ["**/*.e2e.spec.ts"],
    ),
    deps = [
        ":text-field",
        "//:node_modules/@angular/core",
        "//:node_modules/@angular/forms",
        "//:node_modules/@angular/platform-browser",
        "//:node_modules/rxjs",
        "//src/cdk/platform",
        "//src/cdk/testing/private",
    ],
)

ng_web_test_suite(
    name = "unit_tests",
    static_css = [":text_field_prebuilt_scss"],
    deps = [":unit_test_sources"],
)

markdown_to_html(
    name = "overview",
    srcs = [":text-field.md"],
)

filegroup(
    name = "source-files",
    srcs = glob(["**/*.ts"]),
)
